package com.example.mapper;

import com.example.entity.PsInspectiontaskDetail;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.entity.PsInspectiontaskMain;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 * Mapper 接口
 * </p>
 *
 * @author 伍彦端
 * @since 2024-04-24
 */
public interface PsInspectiontaskDetailMapper extends BaseMapper<PsInspectiontaskDetail> {
    /**
     * 根据条件查询
     *
     * @param psInspectiontaskDetail 巡检任务子表对象
     * @return
     */
    public List<PsInspectiontaskDetail> show(@Param("nowPage") Integer nowPage, @Param("pageSize") Integer pageSize,PsInspectiontaskDetail psInspectiontaskDetail);



    @Select("SELECT * FROM ps_inspectiontask_detail WHERE id=#{id}")
    List<PsInspectiontaskDetail> psidlist(@Param("id") Integer id);


    @Select("SELECT * FROM ps_inspectiontask_detail WHERE isbug=#{isbug}")
    List<PsInspectiontaskDetail> pslist(@Param("isbug") Integer isbug);


    @Select("SELECT * FROM ps_inspectiontask_detail AS A INNER JOIN ps_inspectiontask_main AS B ON A.`id`=B.`ps__id` WHERE A.`id`=#{id}")
    List<PsInspectiontaskMain> chaxu(@Param("id") Integer id);

    @Select("SELECT * FROM ps_inspectiontask_detail AS A INNER JOIN ps_inspectiontask_main AS B ON A.`id`=B.`ps__id` WHERE b.inspectionTaskCode={inspectionTaskCode} OR inspectionTaskName={inspectionTaskName}")
    List<PsInspectiontaskDetail> chaxu2(@Param("inspectionTaskCode") String inspectionTaskCode,@Param("inspectionTaskName") String inspectionTaskName);







}
